// 装备调拨
import request from "@/api/request";

// 查所有
export const query_zballot = (params) => {
  return request({
    url: "/equipmanage/allot/selectAll",
    method: "post",
    data: params,
    //   headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

//   删
export const delete_zballot = (params) => {
  return request({
    url: "/equipmanage/allot/delete/" + params,
    method: "post",
    //   headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

//   增
export const add_zballot = (params) => {
  return request({
    url: "/equipmanage/allot/insert",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

//   改
export const update_zballot = (params) => {
  return request({
    url: "/equipmanage/allot/update",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

//   查详情
export const details_zballot = (params) => {
  return request({
    url: "/equipmanage/allot/selectDetails/" + params,
    method: "post",
    //   headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

//   人员列表
export const person_zballot = (params) => {
  return request({
    url: "/equipmanage/allot/userList/" + params,
    method: "post",
  });
};

//   部门列表
export const orglist_zballot = () => {
  return request({
    url: "/equipmanage/allot/orglist",
    method: "post",
  });
};

//   储位列表
export const proorglist_zballot = () => {
  return request({
    url: "/equipmanage/allot/proorglist",
    method: "post",
  });
};

// allot/orglist
// // 仓库
export const depotlist_zballot = () => {
  return request({
    url: "/equipmanage/allot/depotlist",
    method: "post",
  });
};

// 单别
export const category_zballot = (params) => {
  return request({
    url: "/equipmanage/allot/equip/ordCategoryList/" + params,
    method: "post",
  });
};

export const equip_list = (params) => {
  return request({
    url: "/equipmanage/allot/equip/equipList",
    method: "post",
    data: params,
  });
};

// 上传附件
export const upload_scrap = (params) => {
  return request({
    url: "/equipmanage/eadc/upload",
    method: "post",
    data: params,
    headers: { "Content-Type": "multipart/form-data;charset=UTF-8" },
  });
};

// 装备调拨单审核
export const audit_allot = (params) => {
  return request({
    url: "/equipmanage/allot/audit",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 装备调拨单提交
export const commit_allot = (params) => {
  return request({
    url: "/equipmanage/allot/commit",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 单据作废
export const cancel_allot = (params) => {
  return request({
    url: "/equipmanage/allot/cancel",
    method: "post",
    data: params,
  });
};

// // 获取单据审核历史
export const getAuditHistory_allot = (params) => {
  return request({
    url: "/equipmanage/allot/getAuditHistory",
    method: "post",
    data: params,
  });
};

// 装备调拨单回退操作
export const undo_allot = (params) => {
  return request({
    url: "/equipmanage/allot/undo",
    method: "post",
    data: params,
  });
};